{extend name="$_tpl_public_layout_danceadmin"/}


{block name="breadcrumb"}
<ol class="breadcrumb">
	<li class="breadcrumb-item"><a href="{:url('admin/index/index')}">{:config('system.site_title')}</a></li>
	<li class="breadcrumb-item"><a href="{:url('admin/weixinAccount/index')}">{$weixinAccountInfo['wxname']}</a></li>
	<li class="breadcrumb-item"><a href="{:url('weixin_manage/firstpush/index', ['wid'=>$wid])}">{$sideName}</a></li>
</ol>
{/block}


{block name="pageheader"}
{$sideName}
{/block}


{block name="content"}
{include file="index:nav" /}

<div class="card mb-3">
	<div class="card-header">
		关注推送
	</div>
	<div class="card-body">
		关注推送可以用文字、图片、图文列表
		<br>
		关注文字开启的时候，用户关注后，会显示关注文字；否则，会显示关注推送。
		<br>
		图文，一般推送个六七条。
	</div>
</div>

<div class="card mb-3">
	<div class="card-header">
		生成方法
	</div>
	<div class="card-body">
		<form method="post" action="{:url('weixin_manage/firstpush/doTextAdd', array('wid'=>$wid))}" enctype="multipart/form-data" class="form-horizontal J_ajaxForm">
			<input type="hidden" name="id" value="{$id}" />
			<div class="form-group row">
				<label class="col-sm-2 control-label">功能开启</label>
				<div class="col-sm-5"><?php echo isOpenRadioHtmlB('data[isopen]', $info['isopen']); ?></div>
				<div class="col-sm-5"></div>
			</div>
			<div class="form-group row">
				<label class="col-sm-2 control-label">关注推送类型</label>
				<div class="col-sm-5"><?php echo optionRadioHtmlB($firstpush_type_config, 'data[type]', $info['type']); ?></div>
				<div class="col-sm-5"></div>
			</div>
			<div class="form-group row">
				<label class="col-sm-2 control-label">推送文字</label>
				<div class="col-sm-5"><textarea name="data[descrip]" class="form-control" rows="10">{$info['descrip']}</textarea></div>
				<div class="col-sm-5"></div>
			</div>
			<div class="form-group row">
				<label class="col-sm-2 control-label">推送图片</label>
				<div class="col-sm-5">
					<div class="upload-control">
						<input type="file" name="picurl" class="J_uploadfile" />
					</div>
					<div class="upload-show J_preview">
						<img src="{$info['picurl']}" class="upload-img-sm" onerror="Javascript:this.src='/static/danceAdmin/images/nopic.png';" />
					</div>
					<div class="upload-help">不做压缩处理，大小2M以下,建议尺寸640×280px</div>
				</div>
				<div class="col-sm-5"></div>
			</div>
			<div class="clearfix form-actions">
				<div class="offset-md-2 col-sm-10">
					<button type="submit" class="btn btn-primary btn-sm J_ajaxSubmit">保存修改</button>
				</div>
			</div>
		</form>
	</div>
</div>

<div class="card mb-3">
	<div class="card-header">
		图文列表
	</div>
	<div class="card-body">
		<div class="dataTable-toolbar">
			<a href="{:url('weixin_manage/firstpush/add', array('wid'=>$wid))}" class="btn btn-primary btn-sm dataTable-add">添加关注推送</a>
		</div>
		<form method="post" action="{:url('weixin_manage/firstpush/listorders', ['wid'=>$wid])}" class="J_ajaxForm">
			<table class="table table-striped table-bordered table-hover dataTable-table">
				<thead>
					<tr>
						<td width="60">排序</td>
						<td width="100">图片</td>
						<td>标题</td>
						<td>描述</td>
						<td width="60">状态</td>
						<td width="120">操作</td>
					</tr>
				</thead>
				<tbody>
					{volist name="list" id="vo"}
					<tr>
						<td><input type="text" name="vieworders[{$vo['id']}]" value="{$vo['vieworder']}" class="form-control" /></td>
						<td><img src="{$vo['picurl']}" class="upload-img-full" /></td>
						<td><a href="{$vo['link']}" target="_blank">{$vo['title']}</a></td>
						<td>{$vo['descrip']}</td>
						<td>{$vo['status_show']}</td>
						<td>
							<a href="{:url('weixin_manage/firstpush/add', ['wid'=>$wid, 'id'=>$vo['id']])}" class="btn btn-primary btn-xs dataTable-add">编辑</a>
							<a href="{:url('weixin_manage/firstpush/delete', ['wid'=>$wid, 'id'=>$vo['id']])}" class="btn btn-danger btn-xs dataTable-delete J_layerConfirm" data-tip="确认删除吗？">删除</a>
						</td>
					</tr>
					{/volist}
				</tbody>
			</table>
			<div class="dataTable-controll">
				<button type="submit" class="btn btn-success btn-sm J_ajaxSubmit">排序</button>
			</div>
		</form>
	</div>
</div>
{/block}